<template>
    <div class="listCon">
        <van-list v-model="loading" :finished="finished" :finished-text="listData.length ? '没有更多了' : ''">
            <van-swipe-cell v-for="(val, ind) in listData" :key="ind">
                <div class="cellContent">
                    <div class="bottom">
                        <div class="left" @click="handleDetail(val)">
                            <div>
                                <p>
                                    <span class="label">菜谱调研：</span>
                                    {{ val.surveyDesc || '-' }}
                                </p>
                                <p>
                                    <span class="label">调研有效期：</span>
                                    <span>{{ val.effectiveDate || '-' }}</span>
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
            </van-swipe-cell>
        </van-list>
    </div>
</template>
<script>
    // import { getSurById } from '@/api/srvAssurance/smarcatering/myCookbookAdvice';
    export default {
        data() {
            return {
                finished: false,
                loading: false,
                listData: [],
            };
        },
        mounted() {
        },
        methods: {
            // 保存
            handleDetail(item) {
                this.$emit("handleCheckRefresh", item);

            },
            getData(canteenId) {
                this.listData = false;
                this.loading = true;
                getSurById(canteenId).then(res => {
                    this.loading = false;
                    this.finished = true;
                    if (res.code === 1000 && res.data) {
                        this.listData = res.data;

                    }
                }).catch(() => {
                    this.loading = false;
                    this.finished = true;
                });
            },
        },
    };
</script>
<style scoped lang="less">
    .listCon {
        height: 100%;

        .cellContent {
            padding: 0;
            position: relative;

            .top {
                padding: 5px 10px;
                box-sizing: border-box;
                border-bottom: 1px solid #eee;
                position: relative;

                .time {
                    position: absolute;
                    right: 5px;
                    top: 8px;
                    color: #aaa;
                    font-size: 13px;
                }

                .tit {
                    font-size: 15px;
                    height: 30px;

                    b span {
                        font-size: 14px;
                    }

                    .status {
                        background: rgb(70, 172, 240);
                        font-size: 9px;
                        color: #fff;
                        margin-left: 8px;
                        padding: 2px 5px;
                        border-radius: 3px;
                    }

                    .status2 {
                        background: #1aa78f;
                    }

                    .status3 {
                        background: #f25454;
                    }

                    .status4 {
                        background: #b4afaf;
                    }
                }

                .reason {
                    font-size: 13px;
                    color: #aaa;
                    line-height: 20px;
                }

                .type {
                    background: #f2a84e;
                    font-size: 9px;
                    color: #fff;
                    margin-left: 8px;
                    padding: 2px 3px;
                    border-radius: 3px;
                }
            }

            .bottom {
                padding: 5px 10px;
                box-sizing: border-box;
                display: flex;
                overflow: hidden;
                align-items: center;
                border-bottom: 1px solid #eee;

                .left {
                    flex: 1;
                    overflow: hidden;
                }

                .right {
                    margin: 0 5px 0 10px;

                    img {
                        width: 35px;
                        height: 35px;
                    }

                    p {
                        color: #aaa;
                        font-size: 13px;
                    }

                    .van-button {
                        padding: 0 10px;
                        height: 30px;
                        line-height: 30px;
                        border-radius: 17px;
                        font-size: 13px;
                    }
                }
            }

            .flexBtn {
                display: flex;
                justify-content: space-between;

                p {
                    flex: 1;
                    text-align: center;
                    height: 40px;
                    line-height: 40px;
                    color: #4eb3e9;
                    font-size: 15px;
                }

                p:nth-of-type(1) {
                    box-sizing: border-box;
                    border-right: 1px solid #eee;
                    color: #f25454;
                }
            }
        }
    }
</style>